package com.javandad.app.client.searchComponent;

import com.google.gwt.user.client.ui.TextBox;
import com.javandad.app.shared.entity.search.FreetextSearchProperties;
import com.javandad.app.shared.entity.search.SearchProperties;

class EverythingSearch extends Search {
	public EverythingSearch(TextBox freetext) {
		super(freetext);
	}

	@Override
	public String getSearchName() {
		return "Everything";
	}

	@Override
	public SearchProperties getSearchProperties() throws InvalidArgumentException {
		// default impl simply returns a freetext search
		String freetext = freetextSearchTerm.getText();
		FreetextSearchProperties fsp = new FreetextSearchProperties(freetext, FreetextSearchProperties.SEARCH_FOR_ALL);
		return fsp;
	}
}